package com.weixin.dao.impl;

import java.sql.SQLException;

import com.weixin.dao.IDeleteAboutDao;
import com.weixin.util.C3p0Util;

public class DeleteAboutDaoImpl implements IDeleteAboutDao {
	C3p0Util c3p0=new C3p0Util();	
	@Override
	public boolean deletePurchaseTb() throws SQLException {
		String sql="UPDATE purchase_tb set is_show=0";
		int i = c3p0.getqr().update(sql);
		return i>0;
	}

	@Override
	public boolean deleteGoodsTb() throws SQLException {
		String sql="UPDATE goods_tb set is_show=0";
		int i = c3p0.getqr().update(sql);
		return i>0;
	}

	@Override
	public boolean deleteNoIspect() throws SQLException {
		String sql="UPDATE purchase_tb set is_show=0 where inspect=0 and storehouse_id=10";
		int i = c3p0.getqr().update(sql);
		return i>0;
	}

	@Override
	public boolean deleteNoInStroehouse() throws SQLException {
		String sql="UPDATE purchase_tb set is_show=0 where inspect=1 and storehouse_id=10";
		int i = c3p0.getqr().update(sql);
		return i>0;
	}

	@Override
	public boolean deleteInStorehouse() throws SQLException {
		String sql="UPDATE purchase_tb set is_show=0 where inspect=0 and storehouse_id!=10";
		int i = c3p0.getqr().update(sql);
		return i>0;
	}

}
